;;;Writes ASCII character set to the screen and to a file.
(defun c:ascii ()
  (setq chk 2 code -1 ct 0)
  (textpage)
  (getstring "\nWriting to file L:\\UTIL\\LSP\\ASCII.TXT. Press ENTER to continue.")
  (setq vvv (open "L:\\UTIL\\LSP\\ASCII.TXT" "w"))
  (write-line "Decimal\tChar.\tOctal" vvv)
  (princ "\n \n CHARACTER DECIMAL OCTAL\n")
  (while (= chk 2)
    (setq code (1+ code) ct (1+ ct)
	  o1 (rtos (/ (/ code 8) 8) 2 0)
	  o2 (rtos (rem (/ code 8) 8) 2 0)
	  o3 (rtos (rem code 8) 2 0)
	  oct (strcat o1 o2 o3))
    (princ (strcat "\n " (rtos code 2 0) "\t" (chr code) "\t" oct) vvv)
    (princ (strcat "\n\t" (chr code) "\t" (rtos code 2 0) "\t" oct))
    (if (= code 255)
      (setq chk 0)
      (if (= ct 20)
	(progn
	  (setq xxx (getstring (strcat "\n \nPress 'X' to eXit or"
				       " any key to continue: ")))
	  (if (= (strcase xxx) "X")
	    (setq chk 0)
	    (progn
	      (setq ct 0)
	      (princ "\n \n CHARACTER DECIMAL OCTAL\n")
	    )
	  )
	)
      )
    )
  )
  (close vvv)
  (princ)
)